package cn.com.huzo.model.entities.trade;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.sql.Timestamp;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 产品计划主记录实体类
 * <p>
 * @author 吴旭
 */
public class MasterProductionScheduleHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -7613297516168861366L;
    private Long HeaderId;
    private String ContractNo;
    private Timestamp DateOfContract;
    private Long TradeModeId;         // 贸易方式
    private String TradeModeName;
    private String SerialNo;          // 系列号
    private Long SaledBy;             // 业务担当
    private String SaledByName;
    private Integer TotalQuantity;    // 合同总数
    private String Description;
    private String OverFlag;          // 完成标记
    private Short QuotedFlag;         // 是否有被生产指示书所引用

    public Long getHeaderId() {
        return HeaderId;
    }

    public String getContractNo() {
        return ContractNo;
    }

    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Timestamp getDateOfContract() {
        return DateOfContract;
    }

    public Long getTradeModeId() {
        return TradeModeId;
    }

    public String getTradeModeName() {
        return TradeModeName;
    }

    public String getSerialNo() {
        return SerialNo;
    }

    public Long getSaledBy() {
        return SaledBy;
    }

    public String getSaledByName() {
        return SaledByName;
    }

    public String getDescription() {
        return Description;
    }

    public String getOverFlag() {
        return OverFlag;
    }

    public Short getQuotedFlag() {
        return QuotedFlag;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public void setContractNo(String ContractNo) {
        this.ContractNo = ContractNo;
    }

    public void setDateOfContract(Timestamp DateOfContract) {
        this.DateOfContract = DateOfContract;
    }

    public void setTradeModeId(Long TradeModeId) {
        this.TradeModeId = TradeModeId;
    }

    public void setTradeModeName(String TradeModeName) {
        this.TradeModeName = TradeModeName;
    }

    public void setSerialNo(String SerialNo) {
        this.SerialNo = SerialNo;
    }

    public void setSaledBy(Long SaledBy) {
        this.SaledBy = SaledBy;
    }

    public void setSaledByName(String SaledByName) {
        this.SaledByName = SaledByName;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public void setOverFlag(String OverFlag) {
        this.OverFlag = OverFlag;
    }

    public void setQuotedFlag(Short QuotedFlag) {
        this.QuotedFlag = QuotedFlag;
    }

    public Integer getTotalQuantity() {
        return TotalQuantity;
    }

    public void setTotalQuantity(Integer TotalQuantity) {
        this.TotalQuantity = TotalQuantity;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof MasterProductionScheduleHeaderEntity)) {
            return false;
        }

        final MasterProductionScheduleHeaderEntity that = (MasterProductionScheduleHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + this.getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
